package com.example.kotlin

import java.lang.Exception

sealed class Result

class Success(val msg: Msg):Result()
class Failure(val error: Exception):Result()

fun getResult(result: Result)=when(result){
    is Success -> result.msg
    is Failure -> result.error.message
}